TK!2
=v
=u
=l
#1
:n
a
:v
'a1
'a2
'a3
'a4
E
#2
:n
a1
:v
1.1
1.2
1.3
1.4
1.5
1.6
E
#3
:n
a2
:v
2.1
2.2
2.3
2.4
2.5
2.6
E
#4
:n
a3
:v
3.1
3.2
3.3
3.4
3.5
3.6
E
#5
:n
a4
:v
4.1
4.2
4.3
4.4
4.5
4.6
E
#7
:n
b
:v
'b1
'b2
'b3
'b4
'b5
'b6
E
#8
:n
b1
:v
E
#9
:n
b2
:v
E
#10
:n
b3
:v
E
#11
:n
b4
:v
E
#12
:n
b5
:v
E
#13
:n
b6
:v
E
=f
#1
:n
transpose
:c
Transposing matrix A into matrix B
:t
Procedure
:i
A,B
#2
:n
makematrix
:c
Generating matrix A for demo
:t
Procedure
#1
:n
transpose
:z
" Notation:  A  -  master list of the source matrix
"            B  -  master list of the target matrix

for j=1 to length(B)
   call blank(B[j])        " blank all B-lists
next j
for i=1 to length(A)
   Ai:= A[i]
   for j=1 to length(Ai)
      Aij:= elt(Ai,j,'blank)
      if Aij<>'blank then B[j][i]:= Aij
   next j
next i
/E
E
#2
:n
makematrix
:z
for i=1 to 4
   for j=1 to 6
      'a[i][j]:= i + .1*j
   next j
next i
/E
E
=r
#1
:r
"          ***  Matrix  Transposition  ***
:s
C
#3
:r
"      To see the 'transpose' function in action:
:s
C
#5
:r
"      go to table demo, = T > > , and invoke the procedure
:s
C
#7
:r
"      by typing  / E E  call transpose('a,'b)
:s
C
=p
=t
#1
:n
demo
:s
Screen
:v
Horizontal
:f
1
:r
""
:c
""
:t
"==> Press  / E E  and type  call transpose('a,'b) <=="
:u
#1
:l
a1
:w
8
:h
""
#2
:l
a2
:w
8
:h
""
#3
:l
a3
:w
8
:h
""
#4
:l
a4
:w
8
:h
""
#6
:l
b1
:w
8
:h
""
#7
:l
b2
:w
8
:h
""
#8
:l
b3
:w
8
:h
""
#9
:l
b4
:w
8
:h
""
#10
:l
b5
:w
8
:h
""
#11
:l
b6
:w
8
:h
""
E
=n
=g
#1
:c
.000001
:i
10
:v
Yes
:l
60
:f
66
:m
0
:w
80
:b
Yes
:a
Yes
:r
No
:h
No
:t
1
:n
Yes
:d
LPT1
%Tr,f,0,1,0,1,0
